﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using DevComponents.Instrumentation;

namespace IntelliTouchMix
{
    public partial class Deck : Form
    {
        private Color[] _Colors = { Color.Aqua, Color.Lime, Color.Yellow, Color.Orange, Color.Red };
//        private Color[] _Colors = { Color.ForestGreen, Color.Lime, Color.Yellow, Color.Orange, Color.Red };
        private float[] _Positions = { 0f, .25f, .3f, .6f, 1f };
        public Deck()
        {

            InitializeComponent();
            this.volume.PreRenderScalePointer += new System.EventHandler<DevComponents.Instrumentation.PreRenderScalePointerEventArgs>(this.GcLinear8PreRenderScalePointer);
        }

        private void DeckA_Load(object sender, EventArgs e)
        {

            panelWave.Select();
        }

        private void gcLinear8_Click(object sender, EventArgs e)
        {
           // gcLinear8.
        }
        private void GcLinear8PreRenderScalePointer(object sender, PreRenderScalePointerEventArgs e)
        {
             GraphicsPath path = e.Pointer.GetPointerPath();

             if (path != null)
             {
                 Rectangle r = e.Pointer.Scale.Bounds;

                 using (LinearGradientBrush br =
                     new LinearGradientBrush(r, Color.White, Color.White, -90))
                 {
                     ColorBlend cb = new ColorBlend(_Colors.Length);
                     cb.Colors = _Colors;
                     cb.Positions = _Positions;

                     br.InterpolationColors = cb;

                     e.Graphics.FillPath(br, path);
                 }

                 // Tell the system to cancel its rendering, since
                 // we just rendered the contents of the pointer

                 e.Cancel = true;
             }
        }

        private void gcLinear8_Click_1(object sender, EventArgs e)
        {
            MessageBox.Show("value "  + volume.GetPointerValue("Bar1"));
            
        }

    }
}
